﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.IO;
using System.Reflection;

namespace odyssey.Controllers
{
    public class LoaderController : Controller
    {
        public ActionResult js(string id)
        {
            string filePath = id.Replace('-', '/') + ".js";

            using (StreamReader sr = System.IO.File.OpenText(Server.MapPath(Url.Content("~/Scripts/" + filePath))))
            {
                return JavaScript(sr.ReadToEnd());
            }
        }

    }
}
